The block move command allows the user to copy segments of memory to different
locations in memory. The execution of this command does not destroy the original
version unless the location moved to <ADDR> is within the range <RANGE> of the
code being copied. The size option is only available when range is described as
<ADDR>:<COUNT> . If range is being described with the <ADDR>,<ADDR> mode the
size defaults to byte. The size field represents the size transfer that is used
to accomplish the memory move.
Examples of use:
bm 1000,2000 10000
bm 1000:800 10000
bm -l 1000:400 10000 Note: This variation executes the fastest
Note: All of these examples perform the same memory move.
2.5 BREAKPOINT
br
br <ADDR>
br <ADDR> <:COUNT>
br -r [<ADDR>]
br -r
The breakpoint command allows the user to list, insert or delete breakpoints in
the target code. This allows the user to stop executing a program and return to the monitor environment when the specified <ADDR> is prefetched. The different
uses of this command are summarized below:
br list all known breakpoints
br <ADDR> insert a breakpoint at this address
br <ADDR> <:COUNT> insert a breakpoint at this address
,however, return to the monitor
environment only after encountering the
breakpoint <COUNT> number of times.
br -r [<ADDR>] remove the breakpoint at this address
br -r remove all breakpoints
2.6 BLOCK SEARCH
bs [<SIZE>] <RANGE> <DATA>
bs [<SIZE>] <RANGE> <DATA> <MASK>
The block search command allows the user to find a specific pattern within
memory. The search area may extend beyond the <RANGE> specified if a pattern is
started within <RANGE>. There are two primary types of searches:
bs [<SIZE>] <RANGE> <DATA> searches the range for an
exact match of <DATA>.
bs [<SIZE>] <RANGE> <DATA> <MASK> searches the range for any
pattern that matches <DATA>
where there is a "1" in the
binary representation of
the mask.
Ex. With memory at location $100 as shown below, executing
"bs 100,118 $1234 $ffbf" ====>
Starting address: $00000100
Ending address: $00000117
Found at: $00000110:$1234
Found at: $00000114:$1274
Memory for the example above:
$00000100: $0000 $0000 $0000 $0000 $0000 $0000
$0000010C: $0000 $0000 $1234 $0000 $1274 $0000
2.7 CONFIDENCE TEST
ct
The confidence test command allows the user to perform a confidence test of the
system being evaluated. This command is designed to write a -1 into the result
variable (int confres in vardef.h) of the confidence test and then pass the
address of this variable in register a0 to a called subroutine. This routine
writes a 0 or 1 into confres depending on whether the test passes or fails
respectively. If the routine does not place a valid result in this variable
then the monitor assumes that the confidence test was not performed and displays
"ERROR 14:Unable to perform Confidence Test". The confidence test to be
performed is system dependent and has to developed for the system on
which the monitor is running.
2.8 DATA CONVERSION
dc <EXP>
The data conversion command allows the user to evaluate an input expression and
determine its hexadecimal and decimal equivalent.
Examples of use:
NOTE: The following symbols have been defined earlier in order
fpr them to be used in the examples below:
EX 1. uses /start= 0
Ex 2. uses /start= - $18
Ex 3. uses /finish= 10000 and /start=$10000
(see section 2.17 )
Ex. 1 dc $17+/start ====> $17 = &23
Ex. 2 dc $17+/start ====> UNSIGNED : $FFFFFFFF = &4294967295
SIGNED : -$1 = -&1
Ex. 3 dc $/finish-/start ====> $10000 = 65536
2.9 GO
go [<ADDR>]
The go command allows the user to execute target programs. If an address is not
specified on the command line then the current PC value is used.This value is
either 1.)the initialized PC value if no target code has been run,2.)the last
value of the PC used in executing target code or 3.)the value placed into the PC
register by a RM command (Register Modify see section 2.16 ). If an address is
included on the command line then the PC is modified to be the specified addr.
and execution begins at this address. In both cases, the register state that
the microprocessor is intialized to, before executing the target code at this
location, can be viewed by executing a rd command (See section 2.15).
2.10 HELP
? [<symbol>]
he [<symbol>]
help [<symbol>]
The help command allows the user to view a list of allowable commands and the
syntax associated with them. Symbols used to describe the command usage can be
looked up also.
Examples of use:
?,he or help ====> return a complete listing of all commands with usage
? as ====> AS <addr>
help addr ====> <number>
he number ====> <hex> || <dec> || <oct> || <bin> || <symbol>
Note: <number> may also be an expression
2.11 LOAD S-RECORD
lo [<OFFSET>] ;<TEXT>
The load command allows the user to download S-Records from the host system. If
an offset is present on the command line then the target address is the offset
added to the address determined by the S-Record. This command sends the <TEXT>
beyond the ";" to the HOST. It then expects the HOST to begin sending S-Records
to the terminal.
Examples of use:
lo ;cat fbug.mx
Note: The "cat" command is a UNIX command that concatenates and then prints
the specified files using standard output. This effectively sends
the contents of the file to the terminal. The monitor then loads the
contents of the S-Records in the file to the addresses determined by
the S-Records.
lo a0000 ;cat fbug.mx
Note: This command downloads the same S-Record file used
in the first example except that it is down loaded
into memory at the address determined by the
S-Record + $a0000 (ie. the offset is added in).
2.12 MEMORY DISPLAY
md [<SIZE>] <addr>
md [<SIZE>] <RANGE>
md -di <addr>
The memory display command allows the user to view memory. The size used to dis
play the memory is determined by the size option. If no option is used the
default is word. If the range exceeds the screen capacity, output to the screen
is suspended until any key is pressed.
Examples of use:
md -l 100,110
md -l 100:4
md 100:8
md -di 100 Note: This command begins to disassemble the memory at
this location.
2.13 MEMORY MODIFY
mm [<SIZE>] <ADDR>
mm <CONTROL>
The memroy modify command allows the user to view and modify memory. The size
used to display the memory is determined by the size option. The size default
is word. Memory is displayed beginning at the address specified followed by a
'?' prompt. The user may type in an <exp> to replace that memory value or hit
return to view the next memory value. To exit the command, type ". <cr>"
(period <carriage return>). Other available <CONTROL> characters are summarized
below in Table 2.3:
TABLE 2.3 CONTROL CHARACTERS
__________________________________
Control Character Designator
__________________________________
- <EXP> backup <EXP> memory locations
+ <EXP> advance " " "
Examples of use:
mm -l 100 ====> $00000100 $00000000 ?
mm 100 ====> $00000100 $0000 ?
(ie. uses the default "word" size)
2.14 REGISTER DISPLAY
rd
rd -f Note: Only valid if Coprocessor support has been specified
see below.
The register display command allows the user to view the contents of the
registers of the mpu/fpu. Versions released before August 30,1989 only
supported the 68020 programmers model and did not support the coprocessor
(68881/882) programmers model. Versions released after August 30,1989 support
the programmers model that the user specifies before compiling the monitor.
This is done by using the DEVICE,EMULATOR and COPROCESSOR "define" statements in
the "targetsys.h" header file. These defines are discussed further in the
"Target System Configuration" section. The values shown for the registers are
either 1.) the initialized register state if no target code has been run, 2.)
the last values in the registers while executing target code or 3.) the values
specifically placed into the registers by a rm command.
2.15 REGISTER MODIFY
rm [<REGISTER> [<New Value>]]
The RM command allows the user to the modify the contents of the registers of
the mpu.
Examples of use:
To change the PC value:
rm pc 3000 ====> changes the PC value to 3000
or
rm ====> Which register?
pc ====> PC=00004000NEW VALUE?
3000 ====> changes the PC value to 3000
or
rm pc ====> PC=00004000NEW VALUE?
3000 ====> changes the PC value to 3000
2.16 SYMBOL DEFINE
sd [<SYMBOL> <EXP>]
sd -r <SYMBOL>
The symbol define command allows the user to define symbols. These symbols can
then be used within expressions. Using a symbol in an expresion results in the
symbol being substituted with the expresion that was used to define it. Once
defined, the symbol is available until the monitor is reset. If a symbol is
defined multiple times the monitor uses the first definition.
Examples of use:
sd ====> lists which symbols are already
known
sd /reset 10000 ====> defines /reset to be $10000
whenever it is used in an expression.
sd /start -$18 ====> defines /start to be -$18
whenever it is used in an expression.
sd -r /start ====> removes the first definition of /start
from the list
NOTE: Symbols that have been defined using the sd command can
be used in any expressions. An example of this is to
use a symbol defined to enter source code while in
the assembler (ie. bsr /startsub after defining
/startsub).
2.17 TRANSPARENT MODE
tm
The transparent mode command places the user into transparent mode by
establishing a software connection between the HOST and TERMINAL. Transparent
mode preempts normal communication between the TERMINAL and the debugger. While
in this mode all keyboard input is relayed directly to the HOST. HOST responses,
in turn, are returned to the screen. Typing a CTRL A returns the user to the
monitor environment.
2.18 TRACE
tr [<ADDR>][<COUNT>]
The trace command allows the user to trace though target code and observe the
registers after executing the command line. If count is specified then the
microprocessor executes <COUNT> number of instructions before returning to the
monitor environment. Trace begins from the <ADDR> listed on the command line or
from the current PC if an <ADDR> is not included. The trace instruction can be
continued by hitting a carriage return. To exit, a "." must be entered.
Examples of use:
tr ====> traces 1 instruction from the current PC
tr :10 ====> executes 10 instructions past the current
PC then returns to the monitor
environment
tr 1000 ====> traces 1 instruction starting at $1000
CHAPTER 3
USING THE ONE-LINE ASSEMBLER/DISASSEMBLER
3.1 INTRODUCTION
Included in the FBUG monitor is an assembler/disassembler command which can
be executed as detailed in the previous chapter. This assembler/disassembler
allows the user to modify target code. Each source line that is typed in by the
user is entered into memory at the displayed address. This line is then
disassembled so that the user can verify the actual code entered into memory. If
no change is desired a <CR> moves the user to the next opcode in memory.
NOTE: The instruction set that is available to the user is determined when
the monitor is compiled. The choice of the values of DEVICE, EMULATOR
and COPROCESSOR determine which instruction set is available.
See the "Target System Configuration" section below.
CAUTION: This assembler/disassembler does not insert code into the source
program; it merely overwrites memory at that location. As a
result, a program patch that requires code insertion can be
accomplished by first Block Moving code to free up an insertion
area and then inserting into that area.
3.2 ENTERING AND MODIFYING SOURCE PROGRAM
In order to enter and modify source code, the as command should be executed as
detailed in section 2.2 (ie. as <ADDR>). This places the user into the
Assembler/Disassembler routine. Table 3.1 summarizes the commands that can
be executed within this routine:
TABLE 3.1 ASSEMBLER/DISASSEMBLER SUB COMMANDS
__________________________________
Command Designator
__________________________________
BACKUP <EXP> - <EXP>
ADVANCE <EXP> + <EXP>
FINISH .
HELP ?
STEP PAST carriage return
DEFINE CONSTANT DC #<EXP>
Note: Executing a '?' while in the assembler/disassembler returns the DEVICE
that the assembler/disassembler is supporting.
3.3 ENTERING A SOURCE LINE
After executing an as <ADDR> command, the assembler/disassembler
returns with the disassembly of the code found at that location. At this
time the user may execute an assembler command shown in section 3.2 or type in
the source line that is to replace the displayed source code. While entering
source the standard MOTOROLA effective addressing modes are used. These modes